package ui.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import ui.systems.BoardMoveControl;
import ui.systems.CheckersUIBuilder;

/**
 * Listener that when attached to a button will reset the game.
 * @author Team Titanium
 *
 */
public class CheckerBoardNewGameButtonClickListener implements ActionListener {

	public void actionPerformed(ActionEvent arg0) {
		if (arg0.getActionCommand().equalsIgnoreCase("new game")) {
			BoardMoveControl.reset();
			CheckersUIBuilder.getBoardCanvas().setBoard(BoardMoveControl.getBoard());
			CheckersUIBuilder.getBoardCanvas().repaint();
		}

	}

}
